

#include "GraphicsObject.h"

//Primary constructor
GraphicsObject::GraphicsObject(int id):BaseEntity(id)
{
    cout << "\nObject Constructed";
}

//Overloaded constructor to support the game objects position
GraphicsObject::GraphicsObject(int id, double xPos, double yPos, double zPos):BaseEntity(id)
{
    cout << "\nOverloaded Constructor";

    //Assign the objects position based on the constructor
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
}

GraphicsObject::GraphicsObject(int id, ObjectType objType, double xPos, double yPos, double zPos):BaseEntity(id)
{
    cout << "\nSecond Overloaded Constructor";
    
    mObjType = objType;
    
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
    
}
//Update function
void GraphicsObject::Update()
{
    cout << "\nUpdate called";
}

//Setter for object position
void GraphicsObject::setObjectPosition(double xPos, double yPos, double zPos)
{
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
    
}

//Overloaded setter for object position that accepts a Position3D object
void GraphicsObject::setObjectPosition(Position3D position)
{
    mObjectPos.x_Pos = position.x_Pos;
    mObjectPos.y_Pos = position.y_Pos;
    mObjectPos.z_Pos = position.z_Pos;
}

//Getter for object position
Position3D GraphicsObject::getObjectPosition()
{
    return mObjectPos;
}

//Return positions of X, Y, and Z axis respectively
double GraphicsObject::getObjectPositionX(){return mObjectPos.x_Pos;}

double GraphicsObject::getObjectPositionY(){return mObjectPos.y_Pos;}

double GraphicsObject::getObjectPositionZ(){return mObjectPos.z_Pos;}

//Draw graphics object
//===========================================================
//THIS FUNCTION IS TEMPORARY AND FOR TESTING ONLY
//The render function will be the one doing the real drawing. 
//===========================================================
void GraphicsObject::drawObject(ObjectType objType)
{
    
     switch (objType)
     {
         case PYRAMID:
             drawPyramid();
             break;
     
         case CUBE:
             drawCube();
             break;
             
         default:
             break;
     }
    
}


//Setter for object type
void GraphicsObject::setObjectType(ObjectType objType)
{
    mObjType = objType;
}

//Getter for object type
ObjectType  GraphicsObject::getObjectType()
{
    return mObjType;
}
